package com.eheart.demo_jdk21.effective;

/**
 * @Classname
 * @Date 2024/5/30 10:05
 * @CreateBy pan jin
 * Description demo_jdk21
 */
public class Point {
    private int x;
    private int y;

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Point)) return false;
        Point p = (Point) obj;
        return p.x == x && p.y == y;
    }
}
